package com.codefish.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.codefish.entity.SysPermissionEntity;
import com.codefish.entity.SysPermissionMenuEntity;
import com.codefish.mapper.SysPermissionMenuDao;
import com.codefish.service.SysPermissionMenuService;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;


/**
 * 菜单
 *
 * @author codefish
 * @email cool_fish@aliyun.com
 * @date 2021-04-15 05:59:48
 */
@Service("sysPermissionMenuService")
public class SysPermissionMenuServiceImpl extends ServiceImpl<SysPermissionMenuDao, SysPermissionMenuEntity> implements SysPermissionMenuService {


    /**
     * 新增菜单
     * @param menuEntity
     * @return
     */
    @Transactional(propagation = Propagation.SUPPORTS,rollbackFor = Exception.class)
    @Override
    public int saveOne(SysPermissionMenuEntity menuEntity) {
        boolean save = this.save(menuEntity);

        if (save){
            return 1;
        }
        return 0;
    }

}